package com.example.bili.controller;

import com.example.bili.entity.Favor;
import com.example.bili.service.FavorService;
import jakarta.annotation.Resource;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/favor")
public class FavorController {
    @Resource
    private FavorService favorService;


    @GetMapping("/add")
    public Object add(@RequestParam int userId,
                      @RequestParam int trendId,
                      @RequestParam int favorerId){
        return favorService.add(userId, trendId, favorerId);
    }


    @PostMapping("/addFavor")
    public Object addFavor(@RequestBody Favor favor){
        return favorService.addFavor(favor);
    }

    @GetMapping("/delFavor/{id}")
    public Object delFavor(@PathVariable int id){
        return favorService.delFavor(id);
    }
}
